package com.example.shiyun.Adapter;


import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;


import com.example.shiyun.Fragment.PageFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * 引导页的适配器
 */
public class PageFragmentAdapter extends FragmentPagerAdapter {
    private List<PageFragment> fragments = new ArrayList<>();

    public PageFragmentAdapter(FragmentManager fm, List<PageFragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public PageFragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }
}
